-
-
Notifications
You must be signed in to change notification settings - Fork 772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support flattened externally tagged enums with default attributes #2687
base: master
Are you sure you want to change the base?
Conversation
2bad167
to
6acbe14
Compare
The tests fail due to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting approach! I think, you need to add tests with cases from mentioned issues or even better generalize it and cover all possible variants where FlatMapDeserializer
is used
5f9746c
to
9b7b794
Compare
@Mingun thank you for your review and suggestions! I implemented them both. |
9b7b794
to
0c1b047
Compare
I don't know, I am the same external contributor as you. Judging by the general reaction of maintainers, one should hardly expect any attention in the near future |
It is interesting that I went on to try to solve another problem revolving flatten in #2751 and we actually ended up on very similar approach. |
This adds a custom error type for
FlatMapDeserializer
, which distinguishes the specificno variant of enum {name} found in flattened data
error.This error is then used in
deserialize_map
inserde_derive
tomatch
on the returned error, and if the field or container has adefault
attribute it uses theexpr_is_missing
to provide a default value.Fixes #1626